package com.sixth.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sixth.entity.EduTeacher;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface EduTeacherDao extends BaseMapper<EduTeacher> {
    int deleteByPrimaryKey(String id);

    int insert(EduTeacher record);

    int insertSelective(EduTeacher record);

    EduTeacher selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(EduTeacher record);

    int updateByPrimaryKey(EduTeacher record);

    List<EduTeacher> findTeacherList(@Param("name") String name,@Param("mobile") String mobile,@Param("status") String status);

    int updateStatusByid(@Param("id") String id,@Param("status") String status);

//    @Select("<script> select * from edu_teacher et join tb_check_teacher tct on et.id=tct.teacher_id " +
//            "<where>" +
//            "<if test=\"name!=null and name!=''\"> and name like concat ('%',#{name},'%')</if>" +
//            "<if test=\"mobile!=null and mobile!=''\"> and mobile = #{mobile}</if>" +
//            "<if test=\"status!=null and status!=''\">and status = #{status}</if>" +
//            "</where> " +
//            "</script>")
    List<EduTeacher> findTeacherCheck(@Param("name") String name,@Param("mobile") String mobile,@Param("status") String status);
}